package iteratorDemo.example;

/**
 * @author zsh
 * @Description
 * @create 2022-04-14 19:06
 */
public class Main {

    public static void main(String[] args) {
        BookShelf bookShelf = new BookShelf(4);
        bookShelf.appendBook(new Book("a"));
        bookShelf.appendBook(new Book("b"));
        bookShelf.appendBook(new Book("c"));
        bookShelf.appendBook(new Book("d"));
        IteratorIn iteratorIn = bookShelf.iterator();
        while (iteratorIn.hasNext()){
            Book book = (Book) iteratorIn.next();
            System.out.println(book.getName());
        }
    }
}
